//
//  YKCommentHeaderView.m
//  baisi
//
//  Created by 吴高烽 on 16/10/18.
//  Copyright © 2016年 吴高烽. All rights reserved.
//

#import "YKCommentHeaderView.h"

@interface YKCommentHeaderView ()
/** 文字标签 */
@property (nonatomic ,weak)UILabel *label;

@end

@implementation YKCommentHeaderView
+(instancetype)headerViewWithTableView:(UITableView *)tableView{
    static NSString *ID = @"header";
    YKCommentHeaderView *header = [tableView dequeueReusableHeaderFooterViewWithIdentifier:ID];
    if (!header) {
        header = [[YKCommentHeaderView alloc]initWithReuseIdentifier:ID];
    }
    return header ;
}
-(instancetype)initWithReuseIdentifier:(NSString*)identifier{
    if (self = [super initWithReuseIdentifier:identifier]) {
        self.contentView.backgroundColor = YKGlobalBackgroundColor ;
        UILabel *label = [[UILabel alloc]init];
        label.textColor = YKRGBColor(67, 67, 67);
        label.width = 200 ;
        label.x = YKTopictCellMargin ;
        // label 的高度随着父控件的高度改变
        label.autoresizingMask = UIViewAutoresizingFlexibleHeight ;
        [self.contentView addSubview:label];
        self.label = label ;
    }
    return  self ;
}
-(void)setTitle:(NSString *)title{
    _title = [title copy];
    self.label.text = title ;

}
@end
